Windows Phone 8 Application Development Essentials by 2013

Windows Phone 8 Application Development Essentials by 2013

Author:2013
Language: eng
Format: epub
Publisher: Packt Publishing


Tip

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Exposing commands

Command is another object within ViewModel. The Command objects implement the ICommand interface and are associated with the function that performs some action. On the view, the side command should be bound, for instance, to the button.

public class SampleCommandViewModel { public ICommand SampleCommand { get; set; } public SampleCommandViewModel() { SampleCommand = new Command(ExecuteCommand,CanExecuteCommand); } private void ExecuteCommand(object parameter) { //do something here } private bool CanExecuteCommand(object parameter) { return true; } }



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.